<?php
$config = [
    'id' => 'console',
    'basePath' => SYS_ROOT,
    'vendorPath' => YII_ROOT,
    'bootstrap' => ['log'],
    'modules' => [],
    'extensions' => [],
    'controllerNamespace' => 'app\commands',
    'components' => [
        'db2' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'sqlite:' . SYS_ROOT . '/data.db',
        ],
        'log' => require(__DIR__ . '/log.php'),
        'cache_db_schema' => require(__DIR__ . '/cache_db_schema.php'),
        'cache' => require(__DIR__ . '/cache.php'),
        'setting' => [
            'class' => 'app\models\Setting'
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => FALSE,
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.mailgun.org',
                'username' => 'postmaster@avhub8.com',
                'password' => '7b1084e93bdb31d6c3087142bf84239c-4497bd1d-63adb47f',
                'port' => '587',
                'encryption' => 'tls',
            ]
        ],
    ],
];
if (YII_ENV_DEV && is_dir(YII_GII)) {
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'allowedIPs' => ['*']
    ];
}

if (file_exists(__DIR__ . '/db.php')) {
    $config['components']['db'] = require(__DIR__ . '/db.php');
}
return $config;